package com.imohoo.shanpao;

import org.apache.commons.codec.digest.DigestUtils;

import java.util.HashMap;

/**
 * @author zhaobo
 */
public class FileUploadRequest extends HashMap<String, Object> {
    public static final String prefix_circle = "circle/";
    public static final String prefix_thumb = "thumb/";
    public static final String prefix_avatar = "avatar/";
    public static final String prefix_ad = "ad/";
    public static final String prefix_im = "im/";
    public static final String prefix_motion = "motion/";
    public static final String prefix_video = "video/";

    public FileUploadRequest() {
        put("files", "files[]");
    }

    public void setToken(String token) {
        put("token", DigestUtils.md5Hex(token + "upload"));
    }

    public String getToken() {
        return get("token").toString();
    }

    public String getPrefix() {
        return get("prefix").toString();
    }

    public void setPrefix(String prefix) {
        put("prefix", prefix);
    }

    public String getUser_id() {
        return get("suser_id").toString();
    }

    public void setUser_id(long user_id) {
        put("suser_id", user_id);
    }

    public void setFiles(String files) {
        put("files", files);
    }

    public String getFiles() {
        return get("files").toString();
    }

    public void setThumb_id(int thumb_id) {
        put("thumb_id", thumb_id);
    }

    public void setSingleFile() {
        put("files", "files");
    }

    public void setFileMD5(String md5) {
        put("file_md5", md5);
    }

    public void setVideo_time(int video_time) {
        put("video_time", video_time);
    }
}
